#ifndef _TW_WIFI_ADAPT_H
#define _TW_WIFI_ADAPT_H
/*
 * Copyright (c) 2021 Talkweb Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <unistd.h>
#include <string.h>
#include "ohos_init.h"
#include "cmsis_os2.h"
#include "iot_i2c.h"
#include "iot_errno.h"
#include "iot_gpio.h"
#include "iot_gpio_ex.h"

#ifndef TRUE
#define TRUE 1U
#endif

#ifndef FALSE
#define FALSE 0U
#endif

#ifndef BOOL
#define BOOL unsigned char
#endif

// NFC I2C索引号
#define IOT_I2C_IDX_0 0
#define NFC_I2C_INDEX IOT_I2C_IDX_0

// NFC 芯片地址
#define NFC_ADDR 0xAE

// NFC 芯片写地址
#define NFC_WRITE_ADDR 0xAE

// NFC 芯片读地址
#define NFC_READ_ADDR 0xAF

// NFC 芯片EEPROM 页大小
#define NFC_PAGE_SIZE 16

// NFC 芯片EEPROM 开始地址
#define NFC_EEPROM_ADDR_START 0X10

// NFC 芯片EEPROM 结束地址
#define NFC_EEPROM_ADDR_END 0X387

// NFC 芯片EEPROM读写区域大小
#define NFC_EEPROM_SIZE (NFC_EEPROM_ADDR_END - NFC_EEPROM_ADDR_START + 1)

void TWNfcI2cInit(void);
int NfcI2cWrite(const unsigned char *data, unsigned int dataLen);
int NfcI2cRead(const unsigned char *data, unsigned int dataLen);

#endif
